package com.ruoyi.project.system.grades.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.grades.mapper.ClassGradesMapper;
import com.ruoyi.project.system.grades.domain.ClassGrades;
import com.ruoyi.project.system.grades.service.IClassGradesService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 班级Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-04-14
 */
@Service
public class ClassGradesServiceImpl implements IClassGradesService 
{
    @Autowired
    private ClassGradesMapper classGradesMapper;

    /**
     * 查询班级
     * 
     * @param id 班级ID
     * @return 班级
     */
    @Override
    public ClassGrades selectClassGradesById(Long id)
    {
        return classGradesMapper.selectClassGradesById(id);
    }

    /**
     * 查询班级列表
     * 
     * @param classGrades 班级
     * @return 班级
     */
    @Override
    public List<ClassGrades> selectClassGradesList(ClassGrades classGrades)
    {
        return classGradesMapper.selectClassGradesList(classGrades);
    }

    /**
     * 新增班级
     * 
     * @param classGrades 班级
     * @return 结果
     */
    @Override
    public int insertClassGrades(ClassGrades classGrades)
    {
        classGrades.setCreateTime(DateUtils.getNowDate());
        return classGradesMapper.insertClassGrades(classGrades);
    }

    /**
     * 修改班级
     * 
     * @param classGrades 班级
     * @return 结果
     */
    @Override
    public int updateClassGrades(ClassGrades classGrades)
    {
        classGrades.setUpdateTime(DateUtils.getNowDate());
        return classGradesMapper.updateClassGrades(classGrades);
    }

    /**
     * 删除班级对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteClassGradesByIds(String ids)
    {
        return classGradesMapper.deleteClassGradesByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除班级信息
     * 
     * @param id 班级ID
     * @return 结果
     */
    @Override
    public int deleteClassGradesById(Long id)
    {
        return classGradesMapper.deleteClassGradesById(id);
    }
}
